<style>.editable{border:none;}</style>
<div class="admin">
    <div class="tab panel dux-box admin-panel">
        <div class="panel-head"><strong>商品分类</strong></div>
        <div class="padding border-bottom">
            <a href="{:U('add')}" class="button button-small border-green">新增分类</a>
        </div>
        <form method='post' action="" id="myfrom" name="myfrom">
            <table class="table tb-type2">
                <thead>
                    <tr class="thead">
                        <th width="5%">排序</th>
                        <th width="10%">分类名称</th>
                        <th width="20%">关键词</th>
                        <th width="*">描述</th>
                        <th width="6%">显示</th>
                        <th width="10%">操作</th>
                    </tr>
                </thead>
                <tbody>
                <volist name="cat" id="v">
                    <td>{$v["cat_id"]}</td>
                    <td class="name">{$v["cat_name"]}</td>
                    <td>{$v["keywords"]}</td>
                    <td>{$v["cat_desc"]}</td>
                    <td>
                    <if condition="$v['show_in_nav'] eq 1">
                        <a class="button bg-green button-little" href="javascript:(0)" data="1" title="已显示/点击隐藏" onclick="hide({$v['cat_id']},'已显示，确认隐藏此栏目吗？')"><i class="icon-eye"></i>显示</a>
                        <else />
                        <a class="button bg-gray button-little" href="javascript:(0)" data="1" title="未显示/点击显示" onclick="hide({$v['cat_id']},'未置顶，确认显示此栏目吗？')"><i class="icon-eye-slash"></i>隐藏</a>
                    </if>
                    </td>
                    <td>
                        <a class="button bg-blue button-little" href="{:U('/ArticleCat/edit',array('cat_id'=>$v['cat_id']))}" title="编辑"><i class="icon-edit"></i>编辑</a>
                        <a class="button bg-red button-little js-del" data="{$v['cat_id']}"  href="javascript:;" title="删除"><i class="icon-minus-circle"></i>删除</a>
                    </td>
                    </tr>
                </volist>
                </tbody>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
$('#myfrom').layer({
    actionUrl: "batchAction",
    deleteUrl: "{:U('/ArticleCat/del')}",
});
    
function hide(dete,title){
    layer.confirm(title,{btn: ['是的', '算了'] },function(){
            dete = {goods_id:dete};
            var p = Aajax("{:ADMIN_URL}{:U('ArticleCat/cat_hide')}", dete);
            if (p.n){
                layer.msg('操作成功');
                setTimeout("history.go(0)", 1000);
            } else{
                layer.msg('出错请稍后再试');
            }
        }
    );
}
</script>
